import request from "@/netword/request";
const fun = {};


// 根据角色id查询所有权限
fun.getList = async (roleId) => {
    const res = await request({
        url: "/a/core/menuRole/list",
        method: "post",
        params: {
            roleId: roleId,
        }
    })
    return res.data;
}


// 根据角色编码查询所有权限
fun.getList2 = async (roleCode) => {
    const res = await request({
        url: "/a/core/menuRole/list2",
        method: "post",
        params: {
            roleCode: roleCode,
        }
    })
    return res.data;
}


// 根据角色编码查询所有菜单权限
fun.getList3 = async (roleCode) => {
    const res = await request({
        url: "/a/core/menuRole/list3",
        method: "post",
        params: {
            roleCode: roleCode,
        }
    })
    return res.data;
}


// 保存权限数据
fun.save = async (menuRole,falsePid) => {
    const res = await request({
        url: "/a/core/menuRole/save",
        method: "put",
        params: {
            menuIds:menuRole.menuIds,
            falsePid:falsePid,
            roleId:menuRole.roleId
        }
    })
    return res.data;
}






export default fun;